package cn.jinzhu.resilience4j;

import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
import org.springframework.web.bind.annotation.GetMapping;

public class HelloServiceImpl {

    //@Retry(name = "retryA") //resilience4j 里面的retry重试   retryA 配置文件里面自定义的重试名称
    @CircuitBreaker( name = "cbA",fallbackMethod = "error") //resilience4j 里面的断路器  cbA 配置文件里面自定义的断路器名称
    String hello(){
        return "你好";
    }

    public String error(Throwable throwable){
        return  "error";
    }
}
